#include "wifiitemmodel.h"


WiFiItemModel::WiFiItemModel ( QString &_wfEssid,
                               QString &_wfChannel,
                               QString &_wfMac,
                               QString &_wfLeveldBm,
                               QString &_wfLevelPer,
                               QString &_wfEncrypt,
                               QString &_wfEncryptPic,
                               QString &_wfChFreq,
                               QObject *parent ) : ListItem(parent),
    wf_essid(_wfEssid), wf_channel(_wfChannel), wf_mac(_wfMac), wf_leveldBm(_wfLeveldBm),
    wf_levelPer(_wfLevelPer), wf_encrypt(_wfEncrypt), wf_encryptPic(_wfEncryptPic), wf_chFreq(_wfChFreq)
{}

WiFiItemModel::~WiFiItemModel() { }

QVariant WiFiItemModel::data(int role) const
{
  switch(role) {
  case wifiEssid:
    return wfEssid();
  case wifiChannel:
    return wfChannel();
  case wifiMac:
    return wfMac();
  case wifiLeveldBm:
    return wfLeveldBm();
  case wifiLevelPer:
    return wfLevelPer();
  case wifiEncrypt:
    return wfEncrypt();
  case wifiEncriptPic:
    return wfEncryptPic();
  case wifiChFreq:
    return wfChFreq();
  default:
    return QVariant();
  }
}

QHash<int, QByteArray> WiFiItemModel::roleNames() const
{
  QHash<int, QByteArray> names;
  names[wifiEssid] = "wifiEssid";
  names[wifiChannel] = "wifiChannel";
  names[wifiMac] = "wifiMac";
  names[wifiLeveldBm] = "wifiLeveldBm";
  names[wifiLevelPer] = "wifiLevelPer";
  names[wifiEncrypt] = "wifiEncrypt";
  names[wifiEncriptPic] = "wifiEncriptPic";
  names[wifiChFreq] = "wifiChannelFreq";
  return names;
}
